#!/usr/bin/env sh
set -e

. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged --allow-empty

if [ $(git diff --cached --numstat -- ./docs/integrations/all/ ./packages/shared/flows.yaml | wc -l) -gt "0" ]; then
    npm run docs:generate
    git add ./docs/snippets/generated/
fi
